<template>
  <el-form-item style="width: 106px">
    <el-date-picker v-model="query.month" placeholder="请选择月份" type="month" value-format="yyyyMM" @change="change" :editable="false" :clearable="false"/>
  </el-form-item>
</template>

<script>
import Date from '@/utils/datetime'

export default {
  data() {
    return {
      query: {
        month: new Date().strftime('%G%m'),
      }
    }
  },
  methods: {
    change(month) {
      this.$emit('input', month)
      this.$emit('select', month)
    }
  }
}
</script>

<style lang="scss" scoped>
.el-form-item { margin-bottom: 0; }
.el-date-editor { width: auto; }
</style>